﻿
@{
    Layout = null;
}
    @*<link href="~/layui-v2.5.6/layuis/layui.css" rel="stylesheet" />*@    
    <link href="~/Scripts/layui-v2.5.6/layui/css/layui.css" rel="stylesheet" />

    @*引用*@
<div style="width:800px">
    <form class="layui-form" action="/Gathering/Updates">
        <input type="text" hidden id="Id" name="Id" value="" />
      <div class="layui-form-item">
        <label class="layui-form-label">货主单位</label>
        <div class="layui-input-block">
          <input type="text" id="Company" name="Company" required  lay-verify="required" placeholder="请输入货主单位" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">结算方式</label>
        <div class="layui-input-block">
          <input type="radio" name="SettlementMethod" id="SettlementMethod" value="微信支付" title="微信支付">
          <input type="radio" name="SettlementMethod" id="SettlementMethod" value="支付宝支付" title="支付宝支付">
          <input type="radio" name="SettlementMethod" id="SettlementMethod" value="银联支付" title="银联支付">
          <input type="radio" name="SettlementMethod" id="SettlementMethod" value="企业转账" title="企业转账">
          <input type="radio" name="SettlementMethod" id="SettlementMethod" value="线下支付" title="线下支付">
          <input type="radio" name="SettlementMethod" id="SettlementMethod" value="其它" title="其它">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label" >吨位（立方米）</label>
        <div class="layui-input-block">
          <input type="text" id="Tonnage" name="Tonnage" required  lay-verify="required" placeholder="请输入吨位" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label" >单价（立方米）</label>
        <div class="layui-input-block">
          <input type="text" id="Price" name="Price" required  lay-verify="required" placeholder="请输入单价" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">业务日期</label>
        <div class="layui-input-block">
          <input type="text" id="BusinessTIme" name="BusinessTIme" required  lay-verify="required" placeholder="请输入业务日期" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">经办人</label>
        <div class="layui-input-block">
          <input type="text" id="Handler" name="Handler" required  lay-verify="required" placeholder="请输入经办人" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备  注</label>
        <div class="layui-input-block">
          <textarea id="Remarks" name="Remarks" placeholder="请输入备注" class="layui-textarea"></textarea>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" type="submit" lay-submit >立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary" onclick="fh()">返回</button>
        </div>
      </div>
    </form>
</div>
    <script src="~/Scripts/jquery-3.4.1.js"></script>
    <script src="~/layui-v2.5.6/layui/layui.js"></script>
    <script src="~/Scripts/bootstrap.js"></script>
    <script src="~/layer/model/appsettings.js"></script>
<script>
//Demo
        $(function(){
            //文档就绪函数
            GetById();
        })
layui.use('form', function(){
  var form = layui.form;
  form.render();
  //监听提交

  form.on('submit(formDemo)', function(data){
  });
});
function fh(){
    window.parent.location.reload();
    var index = parent.layer.getFrameIndex(window.name);parent.layer.close(index);
}

    var id = @ViewBag.id;
        
        function GetById()
        {
            $.ajax({
                url:"/Gathering/GetAsyncc?id="+id,
                type:"get",
                dataType:"json",
                success:function(obj){
                    console.info(obj);
                    $("#Id").val(obj.id);
                    $("#Company").val(obj.company);
                    $("#SettlementMethod").val(obj.settlementMethod);
                    $("#Tonnage").val(obj.tonnage);
                    $("#Price").val(obj.price);
                    $("#BusinessTIme").val(obj.businessTIme);
                    $("#Handler").val(obj.handler);
                    $("#Remarks").val(obj.remarks);
                }
            })
        }

</script>